class CommentModel {
  int? errcode;
  String? errmsg;
  List<Data>? data;
  String? message;

  CommentModel({this.errcode, this.errmsg, this.data, this.message});

  CommentModel.fromJson(Map<String, dynamic> json) {
    errcode = json['errcode'];
    errmsg = json['errmsg'];
    if (json['data'] != null) {
      data = <Data>[];
      json['data'].forEach((v) {
        data!.add(new Data.fromJson(v));
      });
    }
    message = json['message'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['errcode'] = this.errcode;
    data['errmsg'] = this.errmsg;
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    data['message'] = this.message;
    return data;
  }
}

class Data {
  int? id;
  String? comment;
  String? author;
  String? headerImg;
  String? date;
  String? dateBeauty;
  int? commentNums;
  List<Null>? children;

  Data(
      {this.id,
        this.comment,
        this.author,
        this.headerImg,
        this.date,
        this.dateBeauty,
        this.commentNums,
        this.children});

  Data.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    comment = json['comment'];
    author = json['author'];
    headerImg = json['header_img'];
    date = json['date'];
    dateBeauty = json['date_beauty'];
    commentNums = json['comment_nums'];
    if (json['children'] != null) {
      children = <Null>[];
      json['children'].forEach((v) {
        // children!.add(new Null.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['comment'] = this.comment;
    data['author'] = this.author;
    data['header_img'] = this.headerImg;
    data['date'] = this.date;
    data['date_beauty'] = this.dateBeauty;
    data['comment_nums'] = this.commentNums;
    if (this.children != null) {
      // data['children'] = this.children!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}
